package model;

import java.util.Objects;

/**
 *
 * Group for users in the course.
 * 
 * @author Sergey Nikonenko
 */
public class MoodleGroup {
    private long id;
    private long courseid;
    private String name;
    private String description;
    private long descriptionformat;
    private String enrolmentkey;

    public MoodleGroup() {
    }

    public MoodleGroup(long id, long courseid, String name, String description, long descriptionformat, String enrolmentkey) {
        this.id = id;
        this.courseid = courseid;
        this.name = name;
        this.description = description;
        this.descriptionformat = descriptionformat;
        this.enrolmentkey = enrolmentkey;
    }

    /**
     * Group ID.
     * 
     * @return the id
     */
    public long getId() {
        return id;
    }
    public void setId(long id) {
        this.id = id;
    }

    /**
     * Id of course.
     * 
     * @return the courseid
     */
    public long getCourseid() {
        return courseid;
    }
    public void setCourseid(long courseid) {
        this.courseid = courseid;
    }

    /**
     * Multilang compatible name, course unique.
     * 
     * @return the name
     */
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }

    /**
     * Group description text.
     * 
     * @return the description
     */
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * Description format (1 = HTML, 0 = MOODLE, 2 = PLAIN or 4 = MARKDOWN).
     * 
     * @return the descriptionformat
     */
    public long getDescriptionformat() {
        return descriptionformat;
    }
    public void setDescriptionformat(long descriptionformat) {
        this.descriptionformat = descriptionformat;
    }

    /**
     * Group enrol secret phrase.
     * 
     * @return the enrolmentkey
     */
    public String getEnrolmentkey() {
        return enrolmentkey;
    }
    public void setEnrolmentkey(String enrolmentkey) {
        this.enrolmentkey = enrolmentkey;
    }

    @Override
    public String toString() {
        return "MoodleGroup{" + "id=" + id + ", courseid=" + courseid + ", name=" + name + ", description=" + description + ", descriptionformat=" + descriptionformat + ", enrolmentkey=" + enrolmentkey + '}';
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 17 * hash + Objects.hashCode(this.name);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final MoodleGroup other = (MoodleGroup) obj;
        if (!Objects.equals(this.name, other.name)) {
            return false;
        }
        return true;
    }

 
    
    
}
